﻿using System;
using System.Collections.Generic;
using System.Xml.Serialization;

namespace Mnk.Merger.Code.Repository
{
    [Serializable]
    [XmlRoot("log", Namespace = "", IsNullable = true)]
    public class SvnLogEntities
    {
        public SvnLogEntities()
        {
            LogEntries = new List<SvnLogEntry>();
        }

        [XmlElement("logentry")]
        public List<SvnLogEntry> LogEntries { get; set; }
    }

    [Serializable]
    public class SvnLogEntry
    {
        [XmlAttribute(AttributeName = "revision")]
        public string Id { get; set; }

        [XmlElement("author")]
        public string Author { get; set; }

        [XmlElement("msg")]
        public string Msg { get; set; }

        [XmlElement("paths")]
        public SvnPath SvnPaths { get; set; }
    }

    [Serializable]
    [XmlRoot("paths", Namespace = "", IsNullable = true)]
    public class SvnPath
    {
        [XmlElement("path")]
        public List<string> Paths { get; set; }
    }

    [Serializable]
    public class SvnInfoEntry
    {
        [XmlAttribute(AttributeName = "revision")]
        public string Id { get; set; }

        [XmlElement("url")]
        public string Url { get; set; }

        [XmlElement("repository")]
        public SvnRepositoryEntry Repository { get; set; }
    }

    [Serializable]
    public class SvnRepositoryEntry
    {
        [XmlElement("root")]
        public string Root { get; set; }
    }

    [Serializable]
    [XmlRoot("info", Namespace = "", IsNullable = true)]
    public class SvnInfo
    {
        [XmlElement("entry")]
        public SvnInfoEntry Entry { get; set; }
    }

    [Serializable]
    public class SvnPropertiesTarget
    {
        [XmlElement("property")]
        public string Property { get; set; }
    }

    [Serializable]
    [XmlRoot("properties", Namespace = "", IsNullable = true)]
    public class SvnProperties
    {
        [XmlElement("target")]
        public SvnPropertiesTarget Target { get; set; }
    }
}
